package com.fortune.controller;

import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fortune.base.BaseAPIExcution;
import com.fortune.vo.dSalesManPerformance.Performance;
import com.fortune.vo.dSalesManPerformance.PerformanceHistogram;
import com.fortune.vo.dSalesManPerformance.PerformanceLineChart;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "dSalesManPerformance", description = "经销商业务员业绩统计", tags = {"经销商业务员业绩统计"})
@RestController
@RequestMapping("dSalesManPerformance")
@Validated
public class DSalesManPerformanceController {
	
	@ApiOperation(value = "所有业务员列表", nickname = "dSalesManPerformanceList", notes = "", tags={ "@岳希伟" })
    @GetMapping(value = "allList",
        produces = { MediaType.APPLICATION_JSON_VALUE })
	public BaseAPIExcution<Performance> list() {
		return null;
	}
	
	@ApiOperation(value = "直方图", nickname = "dSalesManHistogramList", notes = "", tags={ "@岳希伟" })
	@ApiImplicitParam(name="histogram", value="近几个月",paramType="query",dataType="int",required=true)
	@GetMapping(value = "latest",
        produces = { MediaType.APPLICATION_JSON_VALUE })
	public BaseAPIExcution<PerformanceHistogram> histogram(@Validated @Min(value=1,message="最少要展示一个月的数据")int month) {
		return null;
	}
	
	@ApiOperation(value = "折线图", nickname = "dSalesManPerformanceList", notes = "", tags={ "@岳希伟" })
	@ApiImplicitParams({
		@ApiImplicitParam(name="month", value="近几个月",paramType="query",dataType="int",required=true),
		@ApiImplicitParam(name="id", value="业务员id",paramType="query",dataType="string",required=true)
	})
	@GetMapping(value = "lineChart",
        produces = { MediaType.APPLICATION_JSON_VALUE })
	public BaseAPIExcution<PerformanceLineChart> lineChart(
			@Validated @Min(value=1,message="最少要展示一个月的数据")int month,
			@Validated @NotBlank(message="业务员id不能为空") String id) {
		return null;
	}
	
}
